<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
  <body>
    <h3>Currently available food items</h3>
    <p>
        <form action="/foodupdater" method="post">
        <table style="width:50%">
            <tr style="font-weight:bold"><td>Name</td><td>Number of kilo calories</td></tr>    
            {% for fooditem in fooditems %}
                <tr>
                    <td>{{ fooditem.name }}</td>
                    <td>{{ fooditem.kcals }}</td>
                    <td>
                        <div><input type="submit" value="Delete"></div>
                        <input type="hidden" name="action" value="delete"/>
                        <input type="hidden" name="fooditemkey" value="{{fooditem.key}}"/> 
                    </td>
                </tr>
            {% endfor %}
        </table>
        </form>         
    </p>
  
    <br><br>
    
    <p>
        <h3>Add a new food item</h3>
        <form action="/foodupdater" method="post">
          <table style="width:50%">
		<tr>
			<td style="width:60%">Name:</td><td><input type="text" name="fooditem_name" size="50"/></td>
		</tr><tr>
			<td style="width:60%">Number of Kilo Calories:</td><td><input type="text" name="fooditem_kcals" size="5"/></td>
		</tr>
	  </table>
          <input type="hidden" name="action" value="add"/>
	  <div><input type="submit" value="Add!"></div>
        </form>
    </p>
    
    <div style="padding-top:30px"><a href="/">Back</a></div>
  </body>
</html>
